﻿using HB.HttpServer;
using Sample.Server.Controller;
using Sample.Server.Filter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sample.Server
{
    internal class Program
    {
        static void Main(string[] args)
        {
            HttpServer hs = new HttpServer();
            //启用文件服务
            hs.UsingFileServer("T:\\doc", true);
            //添加控制器
            hs.AddController<BooksController>();
            //增加全局过滤器
            hs.UsingFilter<ActionFilter>();
            hs.UsingFilter<FileFilter>();
            hs.UsingFilter<ExceptionFilter>();
            hs.UsingFilter<AuthFilter>();
            //开启服务
            hs.Start(8080);
            Console.WriteLine("服务已启动：http:\\127.0.0.1:8080");
            Console.ReadKey();
        }
    }
}
